# -*- coding: utf-8 -*-
'''
Created on 2 sept. 2012

@author: Olivier
'''

class Player(object):
    '''
    Client (réseaux)
        -> Joueur  (donnée) #function Play() qui permet de jouer
            -> JoueurClic
            -> JoueurMove 
    Server
        -> Games (utiliser les joueurs), données de la partie (à qui de jouer, les scores etc)
            
    Window
        -> GamePanel : l'interface graphique de jeu
        -> Connexion Seveur/Client    
    '''
    def __init__(self, inName):
        '''
        Constructor
        '''
        self.__mName = inName
        self.__mScore = 0
        self.__mIsReady = False
        
    def GetName(self):
        '''
        return the name of the player
        '''
        return self.__mName
    
    def SetName(self, inName):
        '''
        Set the name of the player
        '''
        self.__mName = inName
        
    def GetScore(self):
        '''
        Get the score of the player
        '''
        return self.__mScore
    
    def SetScore(self, inScore):
        '''
        Set the score to the player
        '''
        self.__mScore = inScore
        
    def Play(self):
        '''
        function to do something to play
        '''
        assert False, "Virtual function"
        
    def IsReady(self):
        return self.__mIsReady
    
    def SetIsReady(self, inIsReady):
        self.__mIsReady = inIsReady
        
    def __str__(self):
        '''
        return a string represent this object
        '''
        return self.GetName() +': ' +str(self.GetScore())
######################
#MAYBE NOT USED
######################        
class PlayerClic(Player):
    '''
    Class use to create a player who clic on the panel
    '''
    def __init__(self, inName):
        Player.__init__(self, inName)
        
    def Play(self):
        pass
    
class PlayerMove(Player):
    '''
    Class use to create a player who move the man on the panel
    '''
    def __init__(self, inName):
        Player.__init__(self, inName)
        
    def GetPositionX(self):
        return self.__mX
    
    def Play(self):
        pass    
       
class PlayerList(object):
    def __init__(self, inPlayerList):
        self.__mPlayerList = inPlayerList
        
    def GetPlayerList(self):
        return self.__mPlayerList
        
class NewPlayer(object):
    
    def __init__(self, inPlayer):
        self.__mPlayer = inPlayer
        
    def GetPlayer(self):
        return self.__mPlayer
    
class DelPlayer(object):
    
    def __init__(self, inPlayer):
        self.__mPlayer = inPlayer
        
    def GetPlayer(self):
        return self.__mPlayer
    
class MovePlayer(object):
    
    def __init__(self, inPlayer, inPosition, inPositionBite):
        '''
        @inPosition = (X , Y)
        '''
        self.__mPlayer = inPlayer
        self.__mPosition = inPosition
        self.__mPositionBite = inPositionBite
        
    def GetPlayer(self):
        return self.__mPlayer
    
    def GetPosition(self):
        return self.__mPosition
    
    def GetPositionBite(self):
        return self.__mPositionBite
    
class UpdatePlayer(object):
    def __init__(self, inPlayer):
        self.__mPlayer = inPlayer
        
    def GetPlayer(self):
        return self.__mPlayer
    
class ClickPlayer(object):
    
    def __init__(self, inPlayer, inPosition):
        '''
        @inPosition = (X , Y)
        '''
        self.__mPlayer = inPlayer
        self.__mPosition = inPosition
        
    def GetPlayer(self):
        return self.__mPlayer
    
    def GetPosition(self):
        return self.__mPosition
    
        